package com.rephilo.sqlSession;

import com.rephilo.pojo.Configuration;
import com.rephilo.pojo.MappedStatement;

import java.sql.SQLException;
import java.util.List;

public interface Executor {
    /**
     * 执行查询操作
     *
     * @param configuration
     * @param mappedStatement
     * @param params
     * @param <T>
     * @return
     */
    public <T> List<T> query(Configuration configuration, MappedStatement mappedStatement, Object... params) throws SQLException, Exception;

    /**
     * 执行写操作
     *
     * @param configuration
     * @param mappedStatement
     * @param params
     * @return
     * @throws Exception
     */
    Integer update(Configuration configuration, MappedStatement mappedStatement, Object[] params) throws Exception;
}
